import java.math.BigInteger;

public class problem16 {
    public static void main(String[] args) {
        BigInteger number = BigInteger.valueOf(2);
        int power = 1000;

        BigInteger result = number.pow(power);
        String resultString = result.toString();

        BigInteger sum = BigInteger.ZERO;
        for (int i = 0; i < resultString.length(); i++) {
            String character = resultString.substring(i, i+1);
            BigInteger temp = new BigInteger(character);
            sum = sum.add(temp);
        }
        System.out.println(sum.toString());
    }
}